package search_algorithms;

import java.util.PriorityQueue;

import classifiers.Classifier;

import weka.core.Instances;

import data_structures.ConfigurationAccuracyPair;

/**
 * Local search interface.
 */
public interface LocalSearcher {
	/**
	 * Performs a local search in the hyper-parameter configuration space.
	 * 
	 * In each iteration it tries a random neighbor of the current
	 * configuration. It tries confsToTry such configurations plus the initial
	 * configuration. It uses portion portion of the instances (i.e., entire
	 * dataset). Returns the best topK configurations found.
	 * 
	 * @param classifier
	 *            The classifier will be tested.
	 * @param instances
	 *            Entire dataset
	 * @param portion
	 *            Determines the portion of the entire data set to be used
	 * @param confsToTry
	 *            Number of configurations to be tried (i.e., measure the
	 *            accuracy).
	 * @param topK
	 *            Number of best configurations to return
	 * @return topK best configurations found.
	 */
	public PriorityQueue<ConfigurationAccuracyPair> optimize(
			Classifier classifier, Instances instances, double portion,
			int confsToTry, int topK);
}
